Page({
  data: {
    schema:[
    ],
    formData:{
    },
    title: '',
    result: '',
    remark: '',
    apiName: '',
  },
  addVideoToFavorites(e) {
    let that = this
    wx.downloadFile({
      url: "https://product.lvcampaign.com/attached/107/videos/2025-08-20/9d2ed0c1d3954ec5a6c3cca43009a78b.mp4", // 下载url
      success (res) {
    wx.addVideoToFavorites({
      videoPath: res.tempFilePath,
      success: (res1) => {
        that.setData({
          result: res1,
          apiName: e.currentTarget.dataset.apiname 
        })
      },
      fail(err) {
        that.setData({
          result: err,
          apiName: e.currentTarget.dataset.apiname 
        })
      }
    })
  }
  })
  },
  addFileToFavorites(e) {
    let that = this
    wx.downloadFile({
      url: "https://www.cdeledu.com/OtherItem/miniPrivacy/agreement_chinaacc_wx.docx", // 下载url
      success (res) {
    wx.addFileToFavorites({
      filePath: res.tempFilePath,
      success: (res1) => {
        that.setData({
          result: res1,
          apiName: e.currentTarget.dataset.apiname 
        })
      },
      fail(err) {
        that.setData({
          result: err,
          apiName: e.currentTarget.dataset.apiname 
        })
      }
    })
  }
  })
  },
  onLoad(options) {
    wx.setNavigationBarTitle({
      title: options.title,
    })
    
    this.setData({
      title: options.title,
      zh:options.zh,
      remark: options.remark,
      webUrl: options.webUrl
    })
  }
})
